#include "log.h"

extern UART_HandleTypeDef huart1;

uint8_t log_write_to_uart(Log_IO_Drv *thiz, uint8_t *buf, uint32_t len, uint32_t timeout);

Log_IO_Drv st_uart_io = {
    0,
    LOG_IO_UART,
    LOG_OK,
    log_write_to_uart
};

uint8_t log_write_to_uart(Log_IO_Drv *thiz, uint8_t *buf, uint32_t len, uint32_t timeout) {
    if(HAL_UART_Transmit(&huart1, buf, len, timeout) == HAL_OK){
        return LOG_OK;
    }else {
        return LOG_ERROR;
    }
}
